<extend name="Layout/ins_page" />
<block name="content">
    <link href="/sap/demo.css" rel="stylesheet" type="text/css" />
    <script src="/sap/scripts/boot.js" type="text/javascript"></script>
    <div  id='fm1'>
       <fieldset id="fd1" style="border: 1px solid #e5e5e5;height: 50px">
        <legend><span></span></legend>
        <div id="fm1">
        <div class="fieldset-body" style="margin:0px 5px;">
                 
 <!--          买家姓名： <input id="U_Cstname"  name="U_Cstname" class="mini-textbox" enabled='false' />
          手机号码： <input  id="U_Phone"  name="U_Phone" class="mini-textbox"  value=""enabled='false' /><br/><br/> -->
         导入日期：<input id="ctime" class="mini-datepicker" value="" format='yyyy-MM-dd' valueType='string' style='width:8.5%;margin-left:-4px'/>
         订单号：<input type="text" class="mini-textbox" autocomplete="off" placeholder="" id="orderId" name="orderId">
         批次号：<input type="text" class="mini-textbox" autocomplete="off" placeholder="" id="batch_no" name="batch_no">            
          <a class="mini-button" onClick="search()" ><span class="mini-button-text ">&nbsp;&nbsp;查询&nbsp;&nbsp;</span></a>  
      
          <!--<br>
          <span  style="float:right;" >每页 50 条,共 94 条</span>-->
        </div>
        
        
        
          </div>
    </fieldset>
     
        <div class="fieldset-body">

            <div id="tabs1" class="mini-tabs" activeIndex="0" style="width:100%;margin-top: 5px;overflow:auto;" plain="false"
                 buttons="#tabsButtons"
            >
                <div title="列表：" >

                    <div id="datagrid1" class="mini-datagrid" style="height:430px;width: 100%;"
                         url="/Order/boc_get_Ship_list" idField="id"
                         allowResize="true"
                         allowCellEdit="true" allowCellSelect="true" multiSelect="true"
                         allowCellValid="true" oncellvalidation=""
                    >

                        <div property="columns">

                            <div field="orderId"  headerAlign="center"  >订单号
                                <input property="" class="mini-textbox" style="width:100%;" />
                            </div>

                            <div field="expCom"  headerAlign="center"  >快递名称
                                <input property="" class="mini-textbox" style="width:100%;" />
                            </div>
                            <div field="expNo"  headerAlign="center"  >快递单号
                                <input property="" class="mini-textbox" style="width:100%;" />   
                            </div>
							 <div field="batch_no"  headerAlign="center"  >批次号
                                <input property="" class="mini-textbox" style="width:100%;" />   
                            </div>
							
							<div field="ctime"  headerAlign="center"  >上传时间
                                <input property="" class="mini-textbox" style="width:100%;" />   
                            </div>
							
							 <div field="status"  headerAlign="center"  >状态
                                <input property="" class="mini-textbox" style="width:100%;" />   
                            </div>

                        </div>
                    </div>
                </div>
                <!-- <div title="Tab2" iconCls="" >
                    2
                </div> -->
            </div>
        </div>
    </div>


    </body>
    <script type="text/javascript">
        mini.parse();
        var grid = mini.get("datagrid1");
        grid.setPageSize(50);
        grid.load();
        grid.on("drawcell", function (e) {
            var record = e.record,
                column = e.column,
                field = e.field,
                value = e.value;

            //格式化日期
            if (field == "ctime") {
                if (mini.isDate(value)) e.cellHtml = mini.formatDate(value, "yyyy-MM-dd HH:mm");

            }

            /*if (field == "oa_upload_wave_no") {
                e.cellHtml = '<a href="javascript:showList('+value+')"  >' +value+ '</a>';
            }*/

            if (field == "product_id") {
                e.cellHtml = '<a href="javascript:editStock(\''+value+'\')"  >' +value+ '</a>';
            }
			if (field == "status") {
				if(value==0)
				{
                  e.cellHtml ='正常';
				}
				if(value==1)
				{
                  e.cellHtml ='无快递名称';
				}
				if(value==2)
				{
                  e.cellHtml ='无快递单号';
				}
            }
			
			if (field == "stock_type") {
				if(value==1)
				{
                  e.cellHtml ='sap库存';
				}else{
				  e.cellHtml ='手动库存';
				}
            }

        });
         function search(){
			 
			 
		
			var ctime = mini.get('ctime').getValue();
			var orderId = mini.get('orderId').getValue();
			var batch_no= mini.get('batch_no').getValue();
			   mini.mask({
	               el: document.body,
	               cls: 'mini-mask-loading',
	               html: '数据加载中....'
	           }); 
	            
				//console.log(product_name);
			//alert(9999);
			 //return;
      	  $.ajax({
              //url: "index.php?m=&c=Order&a=listupdatestockofboc365byexcel",
			  url:"/Order/boc_get_Ship_list",
              data: {ctime: ctime,orderId:orderId,batch_no:batch_no},
              type: "post",
              dataType:'json',
              success: function (data) {
            	  mini.unmask(document.body);
                  grid.setData(data.data);
                  grid.validateRow(newRow);   //加入新行，马上验证新行
                
              },
              error: function (jqXHR, textStatus, errorThrown) {
				
                  alert(jqXHR.responseText);
              }
          });

        }
		
		
         

    






    </script>
</block>

